package com.xcx.robot.mirai.factory.facade;

import com.xcx.robot.mirai.factory.BaseFacade;
import com.xcx.robot.mirai.key.KeyWord;
import com.xcx.robot.util.ImageUtils;
import net.mamoe.mirai.contact.Contact;
import net.mamoe.mirai.message.data.Image;
import org.springframework.stereotype.Service;

import java.io.File;
import java.util.Objects;

/**
 * @Author: 邢晨旭
 * @Date: 2021/6/22 09:33
 * @Description:
 */
@Service
public class MenuFacade implements BaseFacade {
    public KeyWord keyWord = KeyWord.MENU;


    @Override
    public void execute(Contact sender, Contact receiver, String content) {
        Image image = receiver.uploadImage(Objects.requireNonNull(ImageUtils.initImage(new File("menu.png"))));
        receiver.sendMessage(image);
    }

    @Override
    public KeyWord keyWord() {
        return keyWord;
    }
}
